home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0168_ANIVGA Wormhole.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  2KB  |  88 lines

  1.  
  2. {$A+,B-,D+,L+,N-,E-,O-,Q-,R-,S-,V-,G-,F-,I-,X-}   {Borland Pascal 7.0}
  3. {$M 16384,0,655360}
  4. { File: HI_Worm.pas
  5.   Version: 1.0
  6.   Date: 27-AUGUST-94
  7.   Author: John Howard  jh
  8.   ANIVGA v1.2 implementation of Wormhole from Bas van Gaalen.  Demonstrates
  9.   Pascal routines needed for 320x200x256x4.  I have modified ANIVGA v1.2 to
  10.   provide 320x240x256x4 (not shown here).  The TeleGame (tm) software
  11.   development kit (SDK) utilizes both modes.  TeleGame SDK combines enhanced
  12.   ANIVGA with a multi-user communication protocol and some utilities.  The SDK
  13.   provides a Turbo Pascal development system for VGA game developers.  Release
  14.   date is October 1.
  15.  
  16.   TeleGame (tm) products are available exclusively via:
  17.                             Howard International
  18.                             P.O. BOX 34633
  19.                             North Kansas City, Missouri 64116  USA
  20. }
  21. program Hi_Worm;
  22. USES
  23.     ANIVGA,                       {v1.2}
  24.     CRT;
  25.  
  26. const
  27.     divd=128;
  28.     astep=5;
  29.     xst=3;
  30.     yst=5;
  31.  
  32. var
  33.   sintab : array[0..449] of integer;
  34.   stab,ctab : array[0..255] of integer;
  35.   lstep : byte;
  36.  
  37.  
  38. procedure drawpolar(xo,yo,r,a : word; c : byte);
  39. var x,y : word;
  40. begin
  41.   x:=160+xo+(r*sintab[90+a]) div (divd-20);
  42.   y:=100+yo+(r*sintab[a]) div divd;
  43.   PutPixel(x,y,c);
  44.   { if (x<320) and (y<200) then mem[lvseg:320*y+x] := c; }
  45. end;
  46.  
  47.  
  48. VAR
  49.     x,y,i,j : word;
  50.     c : byte;
  51.     ch : char;
  52.  
  53. BEGIN  {PROGRAM}
  54.   InitGraph;
  55.   Animate; {just to initialize pages, eventually placed sprites}
  56.  
  57.   for i:=0 to 255 do begin
  58.     ctab[i]:=round(cos(pi*i/128)*60);
  59.     stab[i]:=round(sin(pi*i/128)*45);
  60.   end;
  61.   for i:=0 to 449 do sintab[i]:=round(sin(2*pi*i/360)*divd);
  62.  
  63.   {clearscreen(page);}
  64.   x:=30; y:=90;
  65.   repeat
  66.     c:=19; lstep:=2; j:=10;
  67.     while j<220 do begin
  68.       i:=0;
  69.       while i<360 do begin
  70.         drawpolar(ctab[(x+(200-j)) mod 255],stab[(y+(200-j)) mod 255],j,i,c);
  71.         inc(i,astep);
  72.       end;
  73.       inc(j,lstep);
  74.       if (j mod 3)=0 then
  75.       begin
  76.         inc(lstep);
  77.         inc(c);
  78.         if c>31 then c:=31;
  79.       end;
  80.     end;
  81.     x:=xst+x mod 255;
  82.     y:=yst+y mod 255;
  83.     ANIMATE;
  84.   until keypressed;
  85.   while keypressed do ch:=readkey;
  86.   CloseRoutines;
  87. END.   {PROGRAM}
  88.